from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop017"
group_name = '好好学习'
group_sort = '1'
firefox = openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,'商品管理','商品属性','属性分组')

firefox.find_element_by_partial_link_text('添加属性组').click()
firefox.find_element_by_id('attribute_group_name').send_keys(group_name)
firefox.find_element_by_id('attribute_group_sort').clear()
firefox.find_element_by_id('attribute_group_sort').send_keys(group_sort)

firefox.find_element_by_xpath('//button[contains(.,"保存属性组信息")]').click()

try:
    firefox.find_element_by_xpath('//td[contains(.,"%s")]'%group_name)
    writeLog("%s 测试通过" % testCase)
except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)

firefox.quit()